LIBBPF ?= libbpf/src
CLANG ?= clang
CFLAGS := -O2 -g -Wall -Werror -Wno-unused-value -Wno-pointer-sign -Wcompare-distinct-pointer-types -I$(LIBBPF) $(CFLAGS)
MAIN_PACKAGE=main
MAIN_FILE=main.go
LIBRARY_FILE=src_bpfel.o
OUTPUT_FILE=myprogram
all: build

.PHONY:
clean:
	rm -f src_bpfeb.o
	rm -f src_bpfel.o
	rm -f des_bpfeb.o
	rm -f des_bpfel.o
	rm -f myprogram

.PHONY: generate
generate: export BPF_CLANG := $(CLANG)
generate: export BPF_CFLAGS := $(CFLAGS)
generate:
	go generate ./*.go

.PHONY: build
build:
	go build -o $(OUTPUT_FILE) $(MAIN_FILE) src_bpfeb.go